<script setup>
import { RouterLink } from "vue-router";
import ShopInfo from "@/components/home/ShopInfo.vue";
//导入shop仓库
import useShopStore from "@/stores/shop.js";
// 使用shop仓库
const shopStore = useShopStore();
console.log(shopStore.nearByList);
</script>

<template>
  <!-- 附近店铺 -->
  <div class="nearby">
    <h3 class="nearby_title">附近店铺</h3>
    <RouterLink
      v-for="item in shopStore.nearByList"
      :key="item.id"
      :to="{ name: 'shop', params: { id: item.id } }"
    >
      <ShopInfo :shopInfo="item" />
    </RouterLink>
  </div>
</template>

<style lang="scss" scoped>
@import "@/style/viriables.scss";
.nearby {
  &_title {
    margin: 0.16rem 0;
    font-size: 0.18rem;
    font-family: PingFangSC-Medium;
    font-weight: normal;
    line-height: 0.25rem;
    color: $content_fontcolor;
  }

  a {
    text-decoration: none;
  }
}
</style>